Fix/deprecations memory leak entitlements - #2147
Merged
FastestMolasses merged 5 commits intoDec 12, 2025
Merged
Conversation
Resolves build errors with test frameworks (XCTest, Testing) that require macOS 14.0+. This fixes the following linker warnings: - Building for macOS-13.0 but linking with XCTest built for 14.0 - Building for macOS-13.0 but linking with libXCTestSwiftSupport built for 14.0 - Building for macOS-13.0 but linking with Testing framework built for 14.0
- Updated 80+ instances of onChange(of:perform:) to use the new macOS 14.0+ syntax with two-parameter closures (_, newValue in) - Commented out unreachable code in LSPService.swift after early return - Updated Xcode project settings to version 16.1 (LastUpgradeCheck: 2610) - Enabled app sandbox and JIT runtime exceptions for proper execution - Added string catalog symbol generation This resolves all deprecation warnings when targeting macOS 14.0+. Files affected: 39 files Changes: 95 insertions(+), 76 deletions(-)
- Fixed remaining onChange(of:perform:) calls that used explicit 'perform:' label - Updated onChange calls with capture lists to use new two-parameter syntax - Simplified capture list patterns as new onChange provides both old and new values Files fixed: - WorkspacePanelTabBar.swift - EditorTabButtonStyle.swift - EditorTabs.swift (2 instances) - ExtensionsListView.swift All onChange deprecation warnings now resolved.
The app was crashing with REPORT_APP_ENTITLEMENTS_INSUFFICIENT when trying to open file/folder dialogs from the Welcome screen. Added necessary entitlements: - com.apple.security.app-sandbox: Enable App Sandbox - com.apple.security.files.user-selected.read-write: Allow user-selected file access - com.apple.security.files.bookmarks.app-scope: Allow bookmark persistence - com.apple.security.network.client: Enable network access for extensions/LSP This resolves the crash when clicking "Open File or Folder" button.
Fixed memory leak where an UnsafeMutablePointer<passwd> was allocated but never deallocated. Issue Analysis: - Line 43 was allocating heap memory for `result` pointer - getpwuid_r() immediately overwrites `result` to point to `pwd` (stack) - The allocated heap memory was leaked on every call - Attempting to deallocate crashed because `result` pointed to stack memory Root Cause: The allocation was unnecessary. getpwuid_r() expects `result` as an output parameter - it sets the pointer itself, no pre-allocation needed. Solution: Removed the unnecessary .allocate(capacity: 1) call. Now `result` is initialized as nil and getpwuid_r() sets it to point to `pwd` on success. This function is called every time a terminal is opened, so the leak would accumulate with each terminal session.
0xWDG
approved these changes
Dec 8, 2025
FastestMolasses
approved these changes
Dec 12, 2025
matthijseikelenboom
added a commit
to matthijseikelenboom/CodeEdit
that referenced
this pull request
Aug 22, 2026
Five build configs carry ENABLE_APP_SANDBOX = NO and the entitlements file has no app-sandbox key, with nothing in the repo saying why. A reviewer had no way to tell a deliberate decision from a leftover. The sandbox blocks Process from spawning subprocesses, which is what ShellClient, CETerminal, and every git path depend on, so this is the project's long-standing configuration rather than a workaround. PR CodeEditApp#2147 enabled it by accident in December as part of an unrelated fix and broke git, LSP, the terminal, and package installs; commit a2fff0c reverted that. Recording the history so the next person does not repeat it. Also notes the two consequences: App Store distribution is out of scope, and the security-scoped bookmark handling is a deliberate no-op kept for the case where this is revisited.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes multiple issues related to macOS 14 compatibility, compiler warnings, and a memory leak.
Description
onChange(of:perform:)deprecation warningsLSPService.swiftCurrentUser.getCurrentUser()Related Issues
#2133
Checklist
Screenshots